package com.heima.listener;

import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class TestListener {

    @KafkaListener(topics = "test-topic",groupId = "1001")
    public void onMessage1(String message){
        System.out.println("1001有消息");
        System.out.println(message);
    }

    @KafkaListener(topics = "test-topic",groupId = "1002")
    public void onMessage2(String message){
        System.out.println("1002有消息");
        System.out.println(message);
    }
}
